

#include <iostream>
#include <functional>


class Compare_Function {

    private: 
        int my_dat;
    public:
        Compare_Function(int i) { my_dat = i;}
        bool operator() (int i) { return i < my_dat;}
};

class testA {
    public:
        int operator() (int i, int j) { return i + j;}
};

class testB {
    public:
        int print() { std::cout << "testB print" << std::endl; return 1;}
};

int main() {

    int x = testA{}(10, 20);

    std::cout << x << std::endl;

    std::cout << testB{}.print() << std::endl;

    Compare_Function less_than_10(10);

    std::cout << std::boolalpha << less_than_10(9) << std::endl;
    std::cout << std::boolalpha << less_than_10(11) << std::endl;

    //auto plus10 = std::bind(std::plus<int>(), std::placeholders::_1, 10);
    auto plus10 = std::bind(std::plus<int>(), 10, std::placeholders::_1);

    int i = plus10(6);
    std::cout << "plus 10 = " << i << std::endl;


    int j = std::plus<int> {} (1,3);
    std::cout << j << std::endl;

    return 0;
}